#my @flanks=("2kb","5kb","10kb","15kb","20kb");
#foreach my $flank(@flank){
	opendir(DH,"/Users/yaping/Documents/workspace/result/");
	foreach my $file(readdir(DH)){
		if($file=~/methylCGsRich_ASM_AllSnp_(\w+)Merge_(\S+).gtf.20kb.feats.csv/){
			my $sample=$1;
			my $definition = $2;
			open(FH,"</Users/yaping/Documents/workspace/result/$file");
			my @in=<FH>;
			close(FH);
			#my @myin=split "\r",$in[0];
			my $out=0;
			foreach my $line(@in){
				my @splitin=split ",",$line;
				#print "$splitin[1]\n";
				next if $splitin[0] =~/chrom/;
				
				$out = $out + $splitin[3];
			}
			print("$sample\t$definition\t$out\n");
		}
	}
#}